package com.pzr.soccer.config.rabbit;

import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author pzr
 * @date:2021-12-18-11:12
 * @Description:
 **/
@Configuration
public class RabbitConfig {
    public final String Queue_Today_Game_State_Changed="Queue_Today_Game_State_Changed";
    public final String Queue_Today_Game_Changed_Slim="Queue_Today_Game_Changed_Slim";
    public final String Queue_Today_Game_Changed_Full="Queue_Today_Game_Changed_Full";
    public final String Queue_Test="Queue_Test";

    @Bean
    public Queue todayGameStateChangedQueue() {
        // durable:是否持久化,默认是false,持久化队列：会被存储在磁盘上，当消息代理重启时仍然存在，暂存队列：当前连接有效
        // exclusive:默认也是false，只能被当前创建的连接使用，而且当连接关闭后队列即被删除。此参考优先级高于durable
        // autoDelete:是否自动删除，当没有生产者或者消费者使用此队列，该队列会自动删除。
        //   return new Queue("TestDirectQueue",true,true,false)
        //一般设置一下队列的持久化就好,其余两个就是默认false
        return new Queue(Queue_Today_Game_State_Changed,true);
    }
    @Bean
    public Queue todayChangeGameFull(){
        return new Queue(Queue_Today_Game_Changed_Full,true);
    }

    @Bean
    public Queue todayChangeGameSlim(){
        return new Queue(Queue_Today_Game_Changed_Slim,true);
    }

    @Bean
    public Queue queueTest(){
        return new Queue(Queue_Test,true);
    }

}
